package com.jiyun.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiyun.mapper.SpaInfoMapper;
import com.jiyun.model.pojo.Coupon;
import com.jiyun.model.pojo.SpaInfo;
import com.jiyun.model.query.SpaInfoQuery;
import com.jiyun.service.SpaInfoService;
import org.springframework.stereotype.Service;

@Service
public class SpaInfoServiceImpl extends ServiceImpl<SpaInfoMapper, SpaInfo> implements SpaInfoService {

    @Override
    public IPage<SpaInfo> getPageList(SpaInfoQuery query) {
        //1.创建查询条件
        QueryWrapper<SpaInfo> qw = new QueryWrapper<>();
        //ToDo 查询条件

        //2.组件分页数据
        IPage<SpaInfo> page = new Page<>(query.getCurrentPage(), query.getPageSize());
        //3.查询
        baseMapper.selectPage(page,qw);
        //4.返回
        return page;
    }
}
